package com.project.user.controller;

import com.project.user.entity.entitly.UserInfo;
import com.project.user.entity.entitly.UserInformationView;

import java.util.Map;

public interface UserInfoController {
    /**
     * Return the user data set queried by mobile phone number
     *
     * @param userInfoId user id
     * @param phone      user phone
     * @param username   username
     * @throws Exception SqlExample
     * @return Return the user data set queried by mobile phone number
     */
    UserInformationView UserInfo(int userInfoId, String phone, String username) throws Exception;

    /**
     * Business logic for user registration
     *
     * @param password user password
     * @param phone    user phone
     * @return is-successfully:logic for user registration successfully user-info:insert user-id
     * @throws Exception SqlExample
     */
    Map<String,Object> UserInsert(String password, String phone) throws Exception;

    /**
     * Business logic of user login
     *
     * @param password user password
     * @param phone    user phone
     * @return Business logic of user login
     * @throws Exception SqlExample
     */
    UserInfo UserLogin(String password, String phone) throws Exception;

    /**
     * update userinfo
     *
     * @param userInfo user info
     * @return after userinfo
     */
    int updateUserInfo(UserInfo userInfo);
}
